#include<iostream>
using namespace std;

class Static {
    public:
        /**
         * Error:
         * non-const static data member must be intiliazed by out of class.
        static int m = 0;
        */
        static int m;
        /**
         * Warning:
         *in-class initializer for static data member of 'const float' is a GNU extention.
        static const float PI = 3.14f;
        */
        static const float PI;
        void set(int a) {
            m = a;
        }

        /**
         * Error:
         * only constructors take base initializers
        static void staticSet(int a):m(a) {}
         */

        static void staticSet(int a) {
            m = a;
        }

        static void showM() {
            cout << "static m = " << m << endl;
        }
};

/**
 * Error:
 * 'static' can only be specified inside the class definition
int static Static:: m = 0;
*/

int Static::m = 0;
const float Static::PI = 3.14;

int main() {
    cout << "m = " << Static::m << endl;
    Static::staticSet(1);
    Static::showM();
    Static a;
    a.set(5);
    a.showM();
    return 0;
}
